package com.example.filter;

import org.noear.solon.annotation.Component;
import org.noear.solon.core.handle.Context;
import org.noear.solon.core.handle.Filter;
import org.noear.solon.core.handle.FilterChain;

/**
 * index 为顺序位（不加，则默认为0）
 * @author xurongbei
 */
/*@Component(index = 0)*/
public class AppFilter implements Filter {
    @Override
    public void doFilter(Context ctx, FilterChain chain) throws Throwable {
        System.out.println("path:"+ctx.path());
        System.out.println("pathNew:"+ctx.pathNew());
        /*if("/".equals(ctx.pathNew())){
            ctx.pathNew("/index.html");
        }*/
        chain.doFilter(ctx);
    }
}
